﻿using System.Web.Mvc;

namespace CodeContrib.Web.Mvc
{
	public static class ViewContextExtensions
	{
		public static object Eval(this ViewContext viewContext, string key)
		{
			return viewContext.RouteData.Values[key] ?? viewContext.HttpContext.Request.Form[key] ?? viewContext.HttpContext.Request.QueryString[key] ?? viewContext.ViewData.Eval(key);
		}
	}
}